home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIMIMEInputStream.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  147 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIMIMEInputStream.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIMIMEInputStream_h__
  6. #define __gen_nsIMIMEInputStream_h__
  7.  
  8.  
  9. #ifndef __gen_nsIInputStream_h__
  10. #include "nsIInputStream.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIMIMEInputStream */
  19. #define NS_IMIMEINPUTSTREAM_IID_STR "dcbce63c-1dd1-11b2-b94d-91f6d49a3161"
  20.  
  21. #define NS_IMIMEINPUTSTREAM_IID \
  22.   {0xdcbce63c, 0x1dd1, 0x11b2, \
  23.     { 0xb9, 0x4d, 0x91, 0xf6, 0xd4, 0x9a, 0x31, 0x61 }}
  24.  
  25. /**
  26.  * The MIME stream separates headers and a datastream. It also allows
  27.  * automatic creation of the content-length header.
  28.  */
  29. class NS_NO_VTABLE nsIMIMEInputStream : public nsIInputStream {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMIMEINPUTSTREAM_IID)
  33.  
  34.   /**
  35.      * When true a "Content-Length" header is automatically added to the
  36.      * stream. The value of the content-length is automatically calculated
  37.      * using the available() method on the data stream. The value is
  38.      * recalculated every time the stream is rewinded to the start.
  39.      * Not allowed to be changed once the stream has been started to be read.
  40.      */
  41.   /* attribute boolean addContentLength; */
  42.   NS_IMETHOD GetAddContentLength(PRBool *aAddContentLength) = 0;
  43.   NS_IMETHOD SetAddContentLength(PRBool aAddContentLength) = 0;
  44.  
  45.   /**
  46.      * Adds an additional header to the stream on the form "name: value". May
  47.      * not be called once the stream has been started to be read.
  48.      * @param name   name of the header
  49.      * @param value  value of the header
  50.      */
  51.   /* void addHeader (in string name, in string value); */
  52.   NS_IMETHOD AddHeader(const char *name, const char *value) = 0;
  53.  
  54.   /**
  55.      * Sets data-stream. May not be called once the stream has been started
  56.      * to be read.
  57.      * The cursor of the new stream should be located at the beginning of the
  58.      * stream if the implementation of the nsIMIMEInputStream also is used as
  59.      * an nsISeekableStream.
  60.      * @param stream  stream containing the data for the stream
  61.      */
  62.   /* void setData (in nsIInputStream stream); */
  63.   NS_IMETHOD SetData(nsIInputStream *stream) = 0;
  64.  
  65. };
  66.  
  67. /* Use this macro when declaring classes that implement this interface. */
  68. #define NS_DECL_NSIMIMEINPUTSTREAM \
  69.   NS_IMETHOD GetAddContentLength(PRBool *aAddContentLength); \
  70.   NS_IMETHOD SetAddContentLength(PRBool aAddContentLength); \
  71.   NS_IMETHOD AddHeader(const char *name, const char *value); \
  72.   NS_IMETHOD SetData(nsIInputStream *stream); 
  73.  
  74. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  75. #define NS_FORWARD_NSIMIMEINPUTSTREAM(_to) \
  76.   NS_IMETHOD GetAddContentLength(PRBool *aAddContentLength) { return _to GetAddContentLength(aAddContentLength); } \
  77.   NS_IMETHOD SetAddContentLength(PRBool aAddContentLength) { return _to SetAddContentLength(aAddContentLength); } \
  78.   NS_IMETHOD AddHeader(const char *name, const char *value) { return _to AddHeader(name, value); } \
  79.   NS_IMETHOD SetData(nsIInputStream *stream) { return _to SetData(stream); } 
  80.  
  81. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  82. #define NS_FORWARD_SAFE_NSIMIMEINPUTSTREAM(_to) \
  83.   NS_IMETHOD GetAddContentLength(PRBool *aAddContentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddContentLength(aAddContentLength); } \
  84.   NS_IMETHOD SetAddContentLength(PRBool aAddContentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAddContentLength(aAddContentLength); } \
  85.   NS_IMETHOD AddHeader(const char *name, const char *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddHeader(name, value); } \
  86.   NS_IMETHOD SetData(nsIInputStream *stream) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetData(stream); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsMIMEInputStream : public nsIMIMEInputStream
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSIMIMEINPUTSTREAM
  97.  
  98.   nsMIMEInputStream();
  99.  
  100. private:
  101.   ~nsMIMEInputStream();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsMIMEInputStream, nsIMIMEInputStream)
  109.  
  110. nsMIMEInputStream::nsMIMEInputStream()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsMIMEInputStream::~nsMIMEInputStream()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* attribute boolean addContentLength; */
  121. NS_IMETHODIMP nsMIMEInputStream::GetAddContentLength(PRBool *aAddContentLength)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125. NS_IMETHODIMP nsMIMEInputStream::SetAddContentLength(PRBool aAddContentLength)
  126. {
  127.     return NS_ERROR_NOT_IMPLEMENTED;
  128. }
  129.  
  130. /* void addHeader (in string name, in string value); */
  131. NS_IMETHODIMP nsMIMEInputStream::AddHeader(const char *name, const char *value)
  132. {
  133.     return NS_ERROR_NOT_IMPLEMENTED;
  134. }
  135.  
  136. /* void setData (in nsIInputStream stream); */
  137. NS_IMETHODIMP nsMIMEInputStream::SetData(nsIInputStream *stream)
  138. {
  139.     return NS_ERROR_NOT_IMPLEMENTED;
  140. }
  141.  
  142. /* End of implementation class template. */
  143. #endif
  144.  
  145.  
  146. #endif /* __gen_nsIMIMEInputStream_h__ */
  147.